import pyglet
from game import *
from game_over import *

class IncomingWindow(pyglet.window.Window):
    def __init__(self):
        pyglet.window.Window.__init__(self, caption='Incoming!')

        self.app_screen = GameScreen(self)
        self.app_screen.run(self.game_over)

    def on_draw(self):
        self.clear()
        self.app_screen.render()

    def game_over(self, score):
        self.app_screen = GameOverScreen(self, score)

def main():
    win = IncomingWindow()
    pyglet.app.run()

if __name__ == '__main__': main()
